#pragma once

#include <iostream>
#include <sys/epoll.h>
#include <memory>
#include <unordered_map>

#include "Epoller.hpp"
#include "Listener.hpp"
#include "Connection.hpp"

class TcpServer
{
public:
    TcpServer():_epoller_ptr(std::make_unique<Epoller>())
    {

    }


    ~TcpServer()
    {

    }


private:
    std::unique_ptr<Epoller> _epoller_ptr; // epoller类指针
    std::shared_ptr<Listener> _listener_ptr; // listener类指针
    std::unordered_map<int, std::unique_ptr<Connection>> _connections; // fd -> connection, 描述每一个连接
};

